package com.spzx.product.api;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.product.api.domain.ProductSkuVo;
import com.spzx.product.api.factory.RemoteProductFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2025/3/3 19:04
 * @注释
 */
@FeignClient(contextId = "remoteProductService",
        value = ServiceNameConstants.PRODUCT_SERVICE,
        fallbackFactory = RemoteProductFallbackFactory.class)

public interface RemoteProductService {

    @GetMapping("/productSku/getProductSku/{skuId}")
    R<ProductSkuVo> getProductSku(@PathVariable("skuId") Long skuId,
                                  @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
